export default (func) => {
    if (typeof func !== 'function')
        return func;
    return (option = {}, component) => new Promise((success, fail) => {
        func({ ...option, success, fail }, component);
    });
};
